package com.ruoyi.quartz.task;

import com.ruoyi.caipiao.service.ICaipiaoPl5HistoryService;
import com.ruoyi.caipiao.utils.Pl3NumUtilMaxCount_1000;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.concurrent.ThreadPoolExecutor;

/**
 * 定时任务调度测试
 *
 * @author ruoyi
 */
@Component("pl3Task00")
public class Pl3Task00 {

    @Autowired
    private ICaipiaoPl5HistoryService iCaipiaoPl5HistoryService;

    @Resource(name = "threadPoolExecutor1")
    private ThreadPoolExecutor threadPoolExecutor;


    public void get1000(String s, Boolean b, Long l, Double d, Integer i) {
//        System.out.println(StringUtils.format("执行多参方法： 字符串类型{}，布尔类型{}，长整型{}，浮点型{}，整形{}", s, b, l, d, i));
    }

    public void ryParams(String params) {
        System.out.println("执行有参方法：" + params);
    }

    public void getPl3(String size) {
        System.out.println("执行方法:" + size);
        try {
            iCaipiaoPl5HistoryService.allHistory();
        } catch (Exception e) {
        }
        try {
            Long maxQs = iCaipiaoPl5HistoryService.getMaxQs();
            String lastNum = iCaipiaoPl5HistoryService.getById(maxQs.intValue()).getKjNum();
            Pl3NumUtilMaxCount_1000.getData(lastNum, Integer.parseInt(size), threadPoolExecutor);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
    }

}
